<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>通达网络办公系统</title>
<link href="<?php echo base_url()?>css/base.css" type="text/css" rel="stylesheet" />
<link href="<?php echo base_url()?>css/common.css" type="text/css" rel="stylesheet" />
<link href="<?php echo base_url()?>css/pages.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="<?php echo base_url()?>js/jquery-1.7.1.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>js/Clock.js"></script>
<script type="text/javascript" src="<?php echo base_url() ?>/js/menu.js"></script>
<!--[if IE 6]><script type="text/javascript" src="js/pngfix.js"></script><![endif]-->

<script language="javascript">
function selsc()
{
	var objs   =   document.getElementsByName( 'did[]');
	for (var i=0;i<objs.length;i++) {
		var temp=objs[i];
		temp.checked=!temp.checked;
	}
}
function   check(){
	var checkid = '';
	objs   =   document.getElementsByName( 'did[]');
	for(i=0;   i <objs.length;   i++)   {
		if(objs[i].checked   ==   true){
			checkid += objs[i].value+',';					    
		}  
	}
	if(checkid==''){
		alert( '请选择您要操作的选项！');
		return false;
	}else{
		if( confirm('是否将此留言信息删除?')){
			return true;
		}else{
			return false;
		}
	}
} 
function del(id) {
	$.ajax({
		type: "POST",
		url: "<?php echo site_url('article/delart')?>/",
		data: "id="+id,
		success: function(msg){
			$("#tr"+id).fadeOut('slow');
		}
	}); 
};
function edit(id){
	$("input[name='title_"+id+"']").removeClass("ha_border");
	$("input[name='title_"+id+"']").addClass("no_border");
	var old_title = $("input[name='title_old_"+id+"']").val();
	var title = $("input[name='title_"+id+"']").val();
	if(old_title != title && title!=''){	
		
		$.ajax({
			type: "POST",
			url: "<?php echo site_url('article/edit')?>/",
			data: "id="+id+"&title="+title,
			success: function(msg){
				//alert(msg);
			}
		}); 
	}
}
function focus1(id){
	$("input[name='title_"+id+"']").removeClass("no_border");
	$("input[name='title_"+id+"']").addClass("ha_border");
	
}
</script>

</head>

<body>
<!-- OAindex{ -->
<div class="oaindex">
	<?php include_once("system_header.php");?>
    <div class="clearfix">
        <?php include_once("system_left.php");?>
        <!-- right_box{ -->
        <div class="right_box"><form id="abs" name="form1" action="/index.php/article/bulk_operations" method="post" onsubmit="return check();">
            <div class="the_current">
				<span></span>
				<p>当前位置：首页&nbsp&nbsp>>&nbsp&nbsp内容<em style="float:right;padding-right:20px"><a href="/index.php/article/insert">创建公文</a></em></p>
            </div>
			<!-- 表格内容{ -->
			<div class="sheet clearfix">
				<table width="740" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <th width="32"><input name="abc" type="checkbox" onclick="selsc()" value="checkbox" /></th>
                    <th width="165">ID</th>
                    <th width="291">公文类型</th>
                    <th width="244">操作</th>
                  </tr>
				  <?php if(!empty($datas)){ foreach($datas as $item):?>
				  <tr id="tr<?php echo $item->id;?>">
                    <td><input name="did[]" type="checkbox" value="<?php echo $item->id;?>" /></td>
                 
                    <td><?php echo $item->id;?></td>
                    <td><input type="hidden" name="title_old_<?php echo $item->id;?>" value="<?php echo $item->title?>"><input type="text" class="no_border" name='title_<?php echo $item->id?>' value="<?php echo $item->title?>" onfocus="focus1(<?php echo $item->id;?>)" onblur="edit(<?php echo $item->id;?>)"></td>
                                 
                    <td class="handle"><a href="/index.php/article/article_add/<?php echo $item->id;?>">发布内容</a> | <a href="/index.php/article/articlefield/<?php echo $item->id;?>">字段管理</a> | <a href="javascript:del(<?php echo $item->id;?>)" onclick="javascript:return  confirm('是否将此留言信息删除?')">删除</a></td>
                  </tr>
				<?php ?>
				<?php endforeach;}else{ ?> <tr align='center' bgcolor='#ffffff'><td colspan='3'>没有记录！</td></tr><?php }?>                
                </table>
                <p class="whol_button"><input name="btn2" type="submit"  value="批量删除" /></p>

			</div>
			<!-- }表格内容 -->
			 <p class="page"><?echo $this->pager->page("article/index",$current);?><!--<span>到</span><input type="text"/><span>页</span><input class="ok_button" type="button" value="确定" />--></p>
            </form>
        </div>
        <!-- }right_box -->
    </div>
    <?php include_once("system_footer.php");?>
</div>
<!-- }OAindex -->

</body>
</html>